var dbConnection = require('./mysql');
/* 引入express框架 */
const express = require('express');
const app = express();
 
/* 引入cors */
const cors = require('cors');
app.use(cors());
 
/* 引入body-parser */
const bodyParser = require('body-parser');
const e = require('express');
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
//查询卖单列表
/* 监听端口 */
app.listen(8080, () => {
    console.log('——————————服务已启动123——————————');
})
//查询买单列表
app.get('/api/sellList', (req, res) => {
    const mobile = '17852081312';
    dbConnection.query('SELECT sell_order_id,user_id,user_mobile,order_ticket,least_deal_ticket,unit_price FROM fa_user_order_sell WHERE order_status > 0', function(error, results, fields) {
        if (!error) {
            res.json({ code: 1, message: '查询成功', data: results})
        }else{
            res.json({ code: 0, message: '查询失败'})
        }
    });
});
